<template>
  <div class="tiaoxuan_left">
    <ul>
      <li v-for="item in lis" :key="item.id" @click="toright(item)">
        <router-link :to="'/tiaoxuanchexing/' + item.url">
          <p>{{ item.typeName }}</p>
          <p>{{ item.startPrice }}元起</p>
        </router-link>
      </li>
    </ul>
  </div>
</template>

<script>
// 引入请求
import { select, right } from "../../../request/select_car/select_car";
export default {
  props: {},
  data() {
    return {
      lis: [],
    };
  },
  mounted() {
    select().then((res) => {
      this.lis = res.data;

    });
  },
  created() {
    this.init();
  },
  methods: {

    init(){
      this.$http.get("/car/cars/carShopIdTypeId?shopId="+this.$root.shopId+"&type=1").then(res=>{
        this.$root.list_r=res.data.data
      });
    },
    toright(v){
      this.$root.typeId=v.id;
      this.$http.get("/car/cars/carShopIdTypeId?shopId="+this.$root.shopId+"&type="+v.id).then(res=>{
        this.$root.list_r=res.data.data
      });
      this.$emit("left", v.url);
    },
  },
  components: {},
};
</script>

<style scoped lang="less">
.tiaoxuan_left {
  width: 1.49rem;
  height: 100%;
  ul {
    width: 100%;
    display: flex;
    flex-direction: column;
    margin-top: -0.1rem;
    .activing {
      background: white;
      div {
        border-left: 0.05rem solid #4b7ce2;
      }
    }
    li {
      width: 100%;
      height: 1.14rem;
      margin: 0.1rem 0;
      display: flex;
      align-items: center;
      .router-link-active {
        background-color: #fff;
        border-left: 0.05rem solid #4b7ce2;
      }
      a {
        width: 100%;
        height: 100%;
        padding-left: 0.23rem;
        box-sizing: border-box;
        p:first-child {
          width: 100%;
          font-size: 0.23rem;
          font-weight: 600;
        }
        p:last-child {
          font-size: 0.17rem;
          font-weight: 600;
          color: #999999;
        }
      }
    }
  }
}
</style>
